<?php
/**
 * classe que representa os usuarios clientes do site
 * @access public
 * @author Magno Leal
 * @package model
 */
class ClienteBean extends UsuarioBean{

    private $numLances;
    private $avisosPorEmail;

    /**
     * @AssociationType model.Pessoa
     * @AssociationMultiplicity 1
     */
    private $pessoa;
    /**
     * @AssociationType model.Informacao
     * @AssociationMultiplicity *
     */
    private $informacoes;
    /**
     * @AssociationType model.Depoimento
     * @AssociationMultiplicity *
     */
    private $depoimentos;
    /**
     * @AssociationType model.Compra
     * @AssociationMultiplicity *
     */
    private $compras;
    /**
     * @AssociationType model.Convites
     * @AssociationMultiplicity *
     */
    private $convites;
    /**
     * @AssociationType model.ClienteBonus
     * @AssociationMultiplicity *
     */
    private $clienteBonus;
    /**
     * @AssociationType model.CategoriaProduto
     * @AssociationMultiplicity *
     */
    private $interesses;
    /**
     * @AssociationType model.Votos
     * @AssociationMultiplicity *
     */
    private $votos;
    /**
     * @AssociationType model.Votos
     * @AssociationMultiplicity *
     */
    private $lances;

    public function __construct($usuarioID = 0, $login = "", $senha = "", $email = "", 
            $ip = "", $dataCriacao = "", $media = null, $status = null, $numLances = 0, $avisosPorEmail = -1) {
        
        parent::__construct($usuarioID, $login, $senha, $email, $ip, $dataCriacao, $media, $status);
        $this->numLances = $numLances;
        $this->avisosPorEmail = $avisosPorEmail;

    }

    public function getNumLances() {
        return $this->numLances;
    }

    public function setNumLances($numLances) {
        $this->numLances = $numLances;
    }

    public function getAvisosPorEmail() {
        return $this->avisosPorEmail;
    }

    public function setAvisosPorEmail($avisosPorEmail) {
        $this->avisosPorEmail = $avisosPorEmail;
    }

    public function getUsuario() {
        return new UsuarioBean(parent::getUsuarioID(), parent::getLogin(), parent::getSenha(), parent::getEmail(),
                parent::getIp(), parent::getDataCriacao(), parent::getMedia(), parent::getStatus());
    }

    public function setUsuario($usuario) {
        parent::__construct($usuario->getUsuarioID(), $usuario->getLogin(), $usuario->getSenha(), $usuario->getEmail(),
                $usuario->getIp(), $usuario->getDataCriacao(), $usuario->getMedia(), $usuario->getStatus());
    }

    public function getPessoa() {
        return $this->pessoa;
    }

    public function setPessoa($pessoa) {
        $this->pessoa = $pessoa;
    }

    public function setInformacoes($informacoes) {
        $this->informacoes = $informacoes;
    }

    public function setDepoimentos($depoimentos) {
        $this->depoimentos = $depoimentos;
    }

    public function setCompras($compras) {
        $this->compras = $compras;
    }

    public function setConvites($convites) {
        $this->convites = $convites;
    }

    public function setClienteBonus($clienteBonus) {
        $this->clienteBonus = $clienteBonus;
    }

    public function setInteresses($interesses) {
        $this->interesses = $interesses;
    }

    public function setVotos($votos) {
        $this->votos = $votos;
    }

    public function getInformacoes() {
        return $this->informacoes;
    }

    public function getDepoimentos() {
        return $this->depoimentos;
    }

    public function getCompras() {
        return $this->compras;
    }

    public function getConvites() {
        return $this->convites;
    }

    public function getClienteBonus() {
        return $this->clienteBonus;
    }

    public function getInteresses() {
        return $this->interesses;
    }

    public function getVotos() {
        return $this->votos;
    }

    public function getLances() {
        return $this->lances;
    }

    public function setLances($lances) {
        $this->lances = $lances;
    }

    public function toJson() {
        return json_encode($this->toBD());
    }

    public function toBD() {
        $cliente = array();

        $cliente['usuarioID'] = parent::getUsuarioID();
        $cliente['numLances'] = $this->numLances;
        $cliente['avisosPorEmail'] = $this->avisosPorEmail;

        return $cliente;

    }

}
?>
